package tp01;

import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

public class Escritor implements Runnable {

    private RequestCommand command;
    private byte[] adu;

    public Escritor(RequestCommand command, byte[] adu) {
        this.command = command;
        this.adu = adu;

    }

    public void escribir() {
        try {
            command.escribir(adu);
        } catch (IOException ex) {
            Logger.getLogger(Escritor.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public void run() {
        escribir();
    }

}